﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             x:Name="userControl"
             x:Class="Rio.Framework.Pages.Login"
             xmlns:sdk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
             xmlns:CustomConrol="clr-namespace:Rio.Framework.Pages"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"
             d:DesignWidth="1024"
             d:DesignHeight="768">

    <UserControl.Resources>

        <!-- Login Panel Style -->
        <Style x:Key="LoginPanelStyle"
               TargetType="StackPanel">
            <Setter Property="Orientation"
                    Value="Horizontal" />
            <Setter Property="HorizontalAlignment"
                    Value="Right" />
            <Setter Property="RenderTransformOrigin"
                    Value="0.5,0.5" />
        </Style>

        <!--BackGround Login style-->
        <LinearGradientBrush x:Key="LoginBackgroundColorBrush">
            <GradientStop Color="#FF294890"
                          Offset="0.022" />
            <GradientStop Color="#499ED5"
                          Offset="0.536" />
            <GradientStop Color="#FF255D96"
                          Offset="0.728" />
        </LinearGradientBrush>

        <!--TextBox login Style-->
        <Style x:Key="BorderAroundTextBoxLoginStyle"
               TargetType="Border">
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1"
                                         StartPoint="0.5,0">
                        <GradientStop Color="#FF0A445A" />
                        <GradientStop Color="#FF0EB3F1"
                                      Offset="1" />
                        <GradientStop Color="#FE0A526C"
                                      Offset="0.558" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1"
                                         StartPoint="0.5,0">
                        <GradientStop Color="#FF7A7A7A" />
                        <GradientStop Color="#FF424544"
                                      Offset="1" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="CornerRadius"
                    Value="10,10,10,10" />
            <Setter Property="BorderThickness"
                    Value="4,2,5,3" />
        </Style>

        <Style x:Key="TextBoxPasswordStyle"
               TargetType="PasswordBox">
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1"
                                         StartPoint="0.5,0">
                        <GradientStop Color="#FF474545" />
                        <GradientStop Color="#FF9B9B9B"
                                      Offset="1" />
                        <GradientStop Color="#FF646262"
                                      Offset="0.513" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="BorderThickness"
                    Value="6,5,4,3" />
            <Setter Property="RenderTransformOrigin"
                    Value="4.5,4.5" />
        </Style>

        <Style x:Key="TextBoxLoginStyle"
               TargetType="TextBox">
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1"
                                         StartPoint="0.5,0">
                        <GradientStop Color="#FF474545" />
                        <GradientStop Color="#FF9B9B9B"
                                      Offset="1" />
                        <GradientStop Color="#FF646262"
                                      Offset="0.513" />
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="BorderThickness"
                    Value="6,5,4,3" />
            <Setter Property="RenderTransformOrigin"
                    Value="4.5,4.5" />
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutLogin"
          UseLayoutRounding="True"
          DataContext="{Binding}">
        <Grid.Background>
            <ImageBrush Stretch="Fill"
                        ImageSource="/Rio.Framework.Pages;component/Assets/Images/RIO_Background.jpg" />
        </Grid.Background>
        <StackPanel>

            <Grid Margin="0,20,0,0"
                  HorizontalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition Height="50" />
                    <RowDefinition Height="100" />
                    <RowDefinition Height="50" />
                </Grid.RowDefinitions>

                <!--Logo with reflect effect-->
                <Border Margin="0,15,0,0"
                        Grid.Column="1">
                    <StackPanel>
                        <Border  x:Name="controlToReflect"
                                 BorderThickness="1"
                                 CornerRadius="3"
                                 HorizontalAlignment="Center">
                            <Image Name="Logo"
                                   MinWidth="160"
                                   MaxWidth="600"
                                   MinHeight="160"
                                   MaxHeight="200" />
                        </Border>
                        <CustomConrol:ReflectionControl x:Name="shimmer"
                                                        Height="80"
                                                        Margin="3"
                                                        ReflectedElement="{Binding ElementName=controlToReflect}" />
                    </StackPanel>
                </Border>
                <Grid Width="350" Grid.Column="1"
                           Grid.Row="1" HorizontalAlignment="Center">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <!--Login-->
                <sdk:Label Grid.Column="0"
                           Name="labLogin"
                           VerticalAlignment="Center"
                           HorizontalAlignment="Left"
                           Margin="0,0,5,0" />
                <Border Grid.Column="1"
                        Grid.Row="1"
                        Margin="5,0,5,0"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Center"
                        Height="35"
                        >
                    <TextBox Name="TextBoxLogin"
                             Height="28"
                             MinWidth="160"
                             TextWrapping="Wrap"
                             
                             TabIndex="0"
                             Text="{Binding LoginName, ElementName=userControl, Mode=TwoWay}" />
                </Border>
                </Grid>
                <Grid Width="350" Grid.Column="1"
                           Grid.Row="2" HorizontalAlignment="Center">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="90" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50" />
                        <RowDefinition Height="50" />
                    </Grid.RowDefinitions>
                    
                    <!--Password-->
                    <sdk:Label Grid.Column="0"
                           Grid.Row="0"
                           Name="labPassword"
                           VerticalAlignment="Center"
                           HorizontalAlignment="Left"
                           Margin="0,0,5,0" />
                    <Border Grid.Column="1"
                        Grid.Row="0"
                        Margin="5,0,5,0"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Center"
                        Height="35"
                        >
                        <PasswordBox Name="PassBoxPassword"
                                 MinWidth="160"
                                 Height="28"
                                 
                                 TabIndex="1"
                                 Password="{Binding Password, ElementName=userControl, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" />
                    </Border>

                    <!--Connection button-->
                    <telerik:RadButton Name="buttonConnection"
                                   Grid.Column="1"
                                   Grid.Row="1"
                                   HorizontalAlignment="Right"
                                   VerticalAlignment="Center"
                                   Width="125"
                                   Height="28"
                                   TabIndex="2"
                                   Margin="5,0,0,0"
                                   Command="{Binding LoginUserCommand, ElementName=userControl, Mode=TwoWay}" />
                </Grid>
                
            </Grid>
            <sdk:ValidationSummary Name="ValideControl"
                                   Width="300"
                                   MaxHeight="120" />
        </StackPanel>
    </Grid>
</UserControl>
